<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<DoveSiButta.Models.Box>" %>

<ul id="Details">
    <li>Titolo: <%: Model.Title %></li>
        <li>Quando: <%: Model.EventDate.ToShortDateString() %> @ <%: Model.EventDate.ToShortTimeString() %></li>
    <li><a target="_self" href="<%=String.Format("http://maps.google.com/maps?q={0},{1}",Url.Encode(Model.Address),Url.Encode(Model.Country)) %>">Dove: <%: Model.Address %>, <%: Model.Country %></a></li>
    <li>Descrizione: <%: Model.Description %></li>
    <li><a target="_self" href="tel://<%: Model.ContactPhone %>">Organizzatore: <%: Model.HostedBy %> (<%: Model.ContactPhone %>)</a></li>
    <li><a href="#whoscoming">Who's Coming?</a></li>
</ul>

<div id="whoscoming" title="<%: Model.Title %>" class="panel">
    <h2>Chi ha votato?</h2>
            <%if (Model.Ratings.Count == 0){%>
                  <ul><li>Non si &egrave; ancora registrato nessuno.</li></ul>
            <% } %>

        <%if(Model.Ratings.Count > 0) {%>
        <ul id="attendees">
            <%foreach (var RSVP in Model.Ratings){%>
              <li><%: RSVP.AttendeeName.Replace("@"," at ") %></li>    
            <% } %>
        </ul>
        <%} %>
</div>